package main

import (
	"runtime"
	"gim/core"
	"gim/comm"
	log "github.com/golang/glog"
	_ "github.com/icattlecoder/godaemon"
)

func main() {
	max := runtime.NumCPU()
	runtime.GOMAXPROCS(max)
	
	log.Info("core server start")
	
	c := core.StartCore(comm.DB_REDIS_HOST, comm.DB_REDIS_PWD, comm.MQ_REDIS_HOST, comm.MQ_REDIS_PWD, comm.STORAGE_HOST)
	defer core.StopCore(c)
	
	signalCH := comm.InitSignal()
	comm.HandleSignal(signalCH)
	
	log.Info("core server stop")
}